package com.example.rabbit;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class Sender {
	@Autowired
	private RabbitTemplate rabbitTemplate;

	private Logger logger = LoggerFactory.getLogger(Sender.class);

	public void send(String context) {
		logger.info("Sender : " + context);
		this.rabbitTemplate.convertAndSend("exam_response", "exam.response", context);
	}
}

